package InformationRetriever;
import InformationRetriever.*;
import java.util.*;
import InformationRetriever.ComparerMethod.*;

public class ComparerFactory {
    public static IComparer FactoryMethod(String type)
    {
        if(type.equals(Formulas.Cosine.toString()))
            return new CosineComparer();
        else if(type.equals(Formulas.DiceCoefficient.toString()))
            return new DiceCoefficientComparer();
        else if(type.equals(Formulas.EuclideanDistance.toString()))
            return new EuclideanDistanceComparer();
        else if(type.equals(Formulas.InnerProduct.toString()))
            return new InnerProductComparer();
        else if(type.equals(Formulas.JaccardCoefficient.toString()))
            return new JaccardCoefficientComparer();
        else if(type.equals(Formulas.ManhattanDistance.toString()))
            return new ManhattanDistanceComparer();
        else
            return null;
    }
}
